/**
 * Created by syf on 2015/11/14.
 */

var AV=require("leanengine");

var Seller=AV.Object.extend("Seller");

module.exports={
    getSellerBySellerName:function(sellerLoginName){
        var query=new AV.Query(Seller);
        var promise=new AV.Promise();
        if(sellerLoginName){
            query.equalTo("username",sellerLoginName);
            query.find().then(function(seller){
                promise.resolve(seller);
            })
            return promise;
        }else{
            return new AV.Promise.error({code:-100});
        }
    }
}